package chapter7.ArrayList;

import java.util.*;
public class Example {
    public static void main(String[] args) {
        String a = "A", b = "B", c = "C", d = "D", e = "E";
        List<String> list = new ArrayList<String>();
        list.add(a);
        list.add(b);
        list.add(c);
        list.add(d);
        list.add(e);
        Iterator<String> it = list.iterator();
        while (it.hasNext()) {
            String s = it.next();
            System.out.print(s + " ");
        }
    }
}